#ifndef WXSITEMUNDOBUFFER_H
#define WXSITEMUNDOBUFFER_H

#include <wx/arrstr.h>


class wxsItemUndoBuffer {
  public:


    wxsItemUndoBuffer( int MaxEnteries = 100 );


    ~wxsItemUndoBuffer();


    inline bool CanUndo() { return m_CurrentPos > 0; }


    inline bool CanRedo() { return m_CurrentPos < GetCount() - 1; }


    inline bool IsModified() { return m_CurrentPos != m_SavedPos; }


    void StoreChange( const wxString& XmlData );



    inline void Saved() { m_SavedPos = m_CurrentPos; }


    const wxString& Undo();


    const wxString& Redo();

  private:


    inline int GetCount() { return ( int )m_Enteries.Count(); }

    wxArrayString m_Enteries;   ///< \brief Array entries
    int m_CurrentPos;           ///< \brief Current position in undo buffer
    int m_SavedPos;             ///< \brief Undo position representing not-changed resource (in form it's on disk)
    int m_MaxEnteries;          ///< \brief Max entries in undo buffer
};

#endif
